package cn.cy.controller;

import cn.cy.domain.DAO.Semester2step;
import cn.cy.domain.Const.LowerConst;
import cn.cy.domain.StepResult;
import cn.cy.domain.Student;
import cn.cy.service.GetStuInfo;
import cn.cy.service.LowerComputer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/second")
public class SecondController {
    @Autowired
    GetStuInfo getStuInfo;
    Student student = new Student();
    @Autowired
    LowerComputer lowerComputer;
    @Autowired
    Semester2step semester2step;

    @RequestMapping("/tosecond")
    private String tosecond(Model model){
        StepResult popdrawer = lowerComputer.movedrawer(LowerConst.drawerstep);
        if(popdrawer.getCode() == 200){
            student = getStuInfo.getstudent();
            model.addAttribute("stu",student);
            model.addAttribute("msg","核对信息无误后点击确定");
        }
        return  "second";
    }


}
